<template>
	<view class="details">
		<u-navbar
		            :title="this.list.title"
		            @rightClick="rightClick"
		            :autoBack="true"
		        >
		        </u-navbar>
		<img :src="this.list.cover" alt="" class="img">
		<view class="content">
			<p>{{this.list.title}}</p>
			<p>
				<span>{{this.list.sub_count}}人学过</span>
				<span>收藏</span>
			</p>
			<p>
				<span>{{this.list.price}}</span>
				<s>{{this.list.t_price}}</s>
			</p>
		</view>
		<view class="aaaa" v-html="this.list.try">
			
		</view>
	</view>
</template>

<script>
	import {getdetails} from '../request/index.js'
	export default {
		data() {
			return {
				id:'',
				list:[],
			};
		},
		onLoad(options) {
			this.id=options.id
			getdetails({id:this.id}).then(res=>{
				
				if(res.data.msg=='fail'){
					console.log(1111);
					uni.showToast({
						title:'该记录不存在',
						icon:"error",
						
					})
					uni.navigateTo({
						url:'/pages/index/index'
					})
				}else{
					this.list=res.data.data
				}
				console.log(res);
			})
			
			
		},
		methods:{
		}
	}
</script>

<style lang="scss">
.details{
	width: 100%;
	height: 100%;
	.aaaa{
		width: 100%;
		img{
			width: 100%;
		}
	}
	.top{
		width: 100%;
		height: 50px;
		line-height: 50px;
		display: flex;
		box-sizing: border-box;
		padding: 0 10px;
		justify-content: space-between;
	}
	.img{
		width: 100%;
		height: 231px;
	}
	.content{
		width: 100%;
		height: 131px;
		p:nth-child(1){
			
		}
		p:nth-child(2){
			display: flex;
			justify-content: space-between;
		}
		p:nth-child(3){
			span:nth-child(1){
				color: red;
				font-size: 23px;
			}
			s{
				font-size: 14px;
			}
		}
	}
}
</style>
